<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<!-- HTML file produced from file: manual.tex --
 -- using Hyperlatex v 2.3.1 (c) Otfried Cheong--
 -- on Emacs 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid, Fri Dec  3 20:36:14 2004 -->
<HEAD>
<TITLE>Scheme 48 Manual -- Command programs</TITLE>

</HEAD><BODY BGCOLOR="#ffffff">
<EM>Scheme 48 Manual</EM> | <A HREF="s48manual.html#top_node">Contents</A> | In Chapter: <A HREF="s48manual_11.html">Command processor</A><BR>Previous: <A HREF="s48manual_18.html">Inspection mode</A> | Next: <A HREF="s48manual_20.html">Building images</A>
<H2>Command programs</H2>

<P>The <CODE>exec</CODE> package contains procedures that are used
 to execute the command processor's commands.
A command <CODE>,<CODE><I>foo</I></CODE></CODE> is executed by applying the value of
 the identifier <CODE><I>foo</I></CODE> in the <CODE>exec</CODE> package to
 the (suitably parsed) command arguments.
<P><DL><DT><B></B><DD><CODE>,exec [<CODE><I>command</I></CODE>]</CODE><BR>Evaluate <CODE><I>command</I></CODE> in the <CODE>exec</CODE> package.
   For example, use
<BLOCKQUOTE><PRE>
,exec ,load <CODE><I>filename</I></CODE>
</PRE></BLOCKQUOTE>
to load a file containing commands.
If no <CODE><I>command</I></CODE> is given, the <CODE>exec</CODE> package becomes the
 execution package for future commands.
</DL>
<P>The required argument types are as follows:
<UL><LI>filenames should be strings
<LI>other names and identifiers should be symbols
<LI>expressions should be s-expressions
<LI>commands (as for <CODE>,config</CODE> and <CODE>,exec</CODE> itself)
 should be lists of the form
 <CODE>(<CODE><I>command-name</I></CODE> <CODE><I>argument</I></CODE> <CODE><I>...</I></CODE>)</CODE>
 where <CODE><I>command-name</I></CODE> is a symbol.
</UL>
<P>For example, the following two commands are equivalent:
<BLOCKQUOTE><PRE>
,config ,load my-file.scm

,exec (config '(load "my-file.scm"))
</PRE></BLOCKQUOTE>
<P>The file <CODE>scheme/vm/load-vm.scm</CODE> in the source directory contains an
 example of an <CODE>exec</CODE> program.
<P><P>
  
Previous: <A HREF="s48manual_18.html">Inspection mode</A> | Next: <A HREF="s48manual_20.html">Building images</A></BODY></HTML>
